<template>
	<view class="p-20">
		<view v-for="(item,index) in list" :key="index" class="item p-20 b-f b-r-20 m-b-20 p-b-30">
			<view class="f f-a-c m-b-30">
				<view class="left">
					会员类型
				</view>
				<view class="right">
					{{item.identity==1?'普通会员':item.identity==2?'借阅会员':'读书会员'}}
				</view>
			</view>
			<view class="f f-a-c m-b-30">
				<view class="left">
					门店
				</view>
				<view class="right">
					{{userinfo.profile.shop.name}}
				</view>
			</view>
			<view class="f f-a-c m-b-30">
				<view class="left">
					会员级别
				</view>
				<view class="right">
					{{item.level.name}}级
				</view>
			</view>
			<view class="f f-a-c m-b-30">
				<view class="left">
					有效期
				</view>
				<view class="right">
					{{item.identity_end_at}}
				</view>
			</view>
			<view class="f f-a-c m-b-30">
				<view class="left">
					申请时间
				</view>
				<view class="right">
					{{item.created_at}}
				</view>
			</view>
			<view class="f f-a-c ">
				<view class="left">
					状态
				</view>
				<view class="right" :class="{active:ind==1,act:ind==2,actRed:ind==3}">
					{{item.status==1?'待审核':item.status==2?'审核通过':'审核驳回'}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ind: 1,
				page: 1,
				list: [],
				userinfo: uni.getStorageSync('userinfo')
			}
		},
		onReachBottom() {
			this.page++
			this.initList()
			console.log('123456');
		},
		onShow() {
			this.page = 1
			this.list = []
			this.initList()
		},
		methods: {
			async initList() {
				let n = await this.$api.SubscribesPage({
					page: this.page
				})
				this.list = [...this.list, ...n.data.data]
			}
		}
	}
</script>

<style lang="scss" scoped>
	.right {
		font-size: 26rpx;
		font-family: PingFang SC, PingFang SC-Regular;
		font-weight: 400;
		color: #333333;
	}

	.left {
		width: 30%;
		font-size: 26rpx;
		font-family: PingFang SC, PingFang SC-Regular;
		font-weight: 400;
		color: #999999;
	}

	.item {
		width: 100%;
	}

	.active {
		color: #009d85;
	}

	.act {
		color: #999999;
	}

	.actRed {
		color: #D62727;
	}
</style>